/**
  ******************************************************************************
  * @file           : studio_image_base.cpp
  * @author         : wangyingjie
  * @brief          : None
  * @attention      : None
  * @date           : 2025/6/4
  ******************************************************************************
  */

#include "studio_image_base.h"

bool studio_base::valid(const std::string& bin)
{
    return valid(bin.c_str(), bin.size());
}

bool studio_base::valid(const char* data, const size_t len)
{
    if (len < HEADER.size())
    {
        return false;
    }
    for (size_t i = 0; i < HEADER.size(); ++i)
    {
        if (static_cast<uint8_t>(data[i]) != HEADER[i])
        {
            return false;
        }
    }
    return true;
}

bool studio_base::empty()
{
    return m_bytes.empty() || !m_height || !m_width;
}

void studio_base::release()
{
    //   SU_MEM_DEL(m_bytes)
    ///*   for(int i = 0; i < m_height; ++i)
    //   {
    //       SU_MEM_DEL(m_nbytes[i])
    //   }*/
    //   SU_MEM_DEL(m_nbytes)
}